// router.js
import {createRouter, createWebHashHistory} from 'vue-router';
import Login from './components/login.vue';
import Register from './components/register.vue';
import Homepage from "@/components/Homepage.vue";
import UserInfo from "@/components/UserInfo.vue";
import BlogWriting from "@/components/BlogWriting.vue";
import UserSetting from "@/components/UserSetting.vue";
import NullPage from "@/components/NullPage.vue";
import FinancialProjects from "@/components/FinancialProjects.vue";
import Blog from "@/components/Blog.vue";
import BlogDetails from "@/components/BlogDetails.vue";
import SelfUserInfo from "@/components/SelfUserInfo.vue";
import SearchPosts from "@/components/SearchPosts.vue";
import TechnologySharing from "@/components/TechnologySharing.vue";
const routes = [
    { path: '/', component: Homepage },
    { path: '/homepage', name: 'HomePage',component: Homepage },
    { path: '/:user/userinfo', name: 'UserInfo',component: UserInfo},
    { path: '/:user/self_userinfo', name: "SelfUserInfo",component: SelfUserInfo},
    { path: '/search_results/:keywords', name: "SearchPosts",component: SearchPosts},
    { path: '/:user/blog_writing',name: 'BlogWriting',component: BlogWriting},
    { path: '/:user/user_setting',name: 'UserSetting',component: UserSetting},
    { path: '/financial_projects', name: "FinancialProjects",component: FinancialProjects},
    { path: '/blog', name: "BlogAll",component: Blog},
    { path: '/login', name:'LoginView',component: Login},
    { path: '/register', component: Register},
    { path: '/technology_sharing',name:"TechnologySharing",component: TechnologySharing},
    { path: '/:user_id/:post_id/:title',name:'BlogDetails',component: BlogDetails},
    { path: '/:catchAll(.*)',name: "NullPage",component: NullPage}
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});


export default router;
